﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Qimo
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            var id = textBox1.Text;
            var pwd = textBox2.Text;
            var rePwd = textBox3.Text;

            var hasids = !string.IsNullOrEmpty(id);
            var hasPwd = !string.IsNullOrEmpty(pwd);
            
                    if (hasids && hasPwd)
                    {                  
                        string cmd = "insert into Users (Username,Password) values ('{textBox1.Text}','{textBox2.Text}',uid,pwd)";
                        var cmdd = DbHelper.GetDataTable(cmd);
                        MessageBox.Show("注册成功！");
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("注册失败！");          
                    }               
            

        }
        private void button3_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {

        }

        private void Form2_Load(object sender, EventArgs e)
        {

        }
    }
    
}